package com.yjd.comm.settlement.service;

import com.yjd.comm.base.enums.DbWREnums;
import com.yjd.comm.base.service.IBaseService;
import com.yjd.comm.settlement.model.ClearDayDetailModel;

import java.util.List;
import java.util.Map;

/**
 * <b>description</b>：日结算明细业务接口<br>
 * <b>time</b>：2017-08-11 17:27:54 <br>
 * <b>author</b>：  yangchangyan@yijiedai.com
 */
public interface IClearDayDetailService extends IBaseService {
	/**
	 * 插入
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public ClearDayDetailModel insert(ClearDayDetailModel model) throws Exception;

	/**
	 * 批量插入
	 *
	 * @param models
	 * @return
	 * @throws Exception
	 */
	public int insertBatch(List<ClearDayDetailModel> models) throws Exception;

	/**
	 * 更新,大于等于1表示成功，其他失败
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public int update(ClearDayDetailModel model) throws Exception;

	/**
	 * 根据id删除,大于等于1表示成功，其他失败
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public int delete(long id) throws Exception;


	/**
	 * 统计日结 平台支出金额
	 * @param clear_date
	 * @return
	 * @throws Exception
	 */
	public Double statisticsPfBorrowPriceOfDay(Integer clear_date)throws Exception;

	/**
	 * 统计日结 平台收入金额
	 * @param clear_date
	 * @return
	 * @throws Exception
	 */
	public Double statisticsPfLoanPriceOfDay(Integer clear_date)throws Exception;

	/**
	 * 统计日结 平台交易金额
	 * @param clear_date
	 * @return
	 * @throws Exception
	 */
	public Double statisticsPfTradePriceOfDay(Integer clear_date)throws Exception;

	/**
	 * 统计日结 平台交易笔数
	 * @param clear_date
	 * @return
	 * @throws Exception
	 */
	public int statisticsPfTradeCountOfDay(Integer clear_date)throws Exception;

	/**
	 * 统计日结 平台退回笔数
	 * @param clear_date
	 * @return
	 * @throws Exception
	 */
	public int statisticsPfRefundCountOfDay(Integer clear_date)throws Exception;

	/**
	 * 查询商户日结明细
	 *
	 * @param paramMap 查询参数列表
	 * @param write 是否是操作主库
	 * @return 返回结果列表
	 * @throws Exception
	 */
	public List querySettlementDetail(Map<String, Object> paramMap, DbWREnums write) throws Exception;

}
